// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import 'babel-polyfill'
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import fastclick from 'fastclick'
import VueLazyLoad from 'vue-lazyload'

// import {SET_PLAY_HISTORY, SET_FAVORITE_LIST} from './store/mutation-types'
// import {loadPlay, loadFavorite} from 'common/js/cache'
// import {processSongsUrl} from 'common/js/song'

import 'common/stylus/index.styl'

fastclick.attach(document.body)
Vue.use(VueLazyLoad, {
  loading: require('common/image/default.png')
})

// const historySongs = loadPlay()
// processSongsUrl(historySongs).then((songs) => {
//   store.commit(SET_PLAY_HISTORY, songs)
// })
//
// const favoriteSongs = loadFavorite()
// processSongsUrl(favoriteSongs).then((songs) => {
//   store.commit(SET_FAVORITE_LIST, songs)
// })

// Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: {App},
  template: '<App/>'
})
